<template>
  <div class="con-page">
    <div class="con">
      <!--      <Button type="info" style="margin-left:10px" @click="check_search=true;">查询</Button>-->
      <div style="text-align: center; width: 750px; padding-top: 10px">
        <span>检验日期</span>
        <Date-picker
          type="date"
          placeholder="选择日期"
          style="width: 40%"
          v-model="queryParams.xjtDateBegin"
          @on-change="get_date($event, 's')"
        ></Date-picker>
        —
        <Date-picker
          type="date"
          placeholder="选择日期"
          style="width: 40%"
          v-model="queryParams.xjtDateEnd"
          @on-change="get_date($event, 'e')"
        ></Date-picker>
        <Button type="info" style="display: inline-block" @click="getList"
          >查询</Button
        >
      </div>
    </div>

    <div style="position: relative; width: 991px">
      <div style="position: absolute; right: 0; top: -30px">
        <Page
          :total="total"
          :current.sync="queryParams.pageNum"
          simple
          :page-size="queryParams.pageSize"
          show-elevator
          @on-change="pageChange"
        ></Page>
      </div>
      <el-table
        id="NoPlanAssign"
        border
        stripe
        style="width: 991px"
        highlight-current-row
        :data="xjtData"
        :header-cell-style="{ 'text-align': 'center' }"
      >
        <el-table-column label="#" width="40" type="index" align="center" />
        <el-table-column
          label="机台编号"
          :show-overflow-tooltip="true"
          width="150"
          align="center"
          prop="xjtJtbh"
        />
        <el-table-column
          label="检验日期"
          :show-overflow-tooltip="true"
          width="100"
          align="center"
          prop="xjtJyrq"
        />
        <el-table-column
          label="班次代码"
          :show-overflow-tooltip="true"
          width="100"
          align="center"
          prop="xjtBbdm"
        />
        <el-table-column
          label="巡检时段"
          :show-overflow-tooltip="true"
          width="100"
          align="center"
          prop="xjtXjrq"
        />
        <el-table-column
          label="客户编码"
          :show-overflow-tooltip="true"
          width="150"
          align="center"
          prop="xjtCustwldm"
        />
        <el-table-column
          label="物料品名"
          :show-overflow-tooltip="true"
          width="250"
          align="center"
          prop="xjtWlpm"
        />
        <el-table-column
          label="操作"
          align="center"
          width="100"
          class-name="small-padding fixed-width"
        >
          <template #default="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              >填写</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>

    <el-dialog v-model="open" width="100%" fullscreen>
      <div style="text-align: center; border-bottom: none">
        <div style="width: 100%; position: relative">
          <h1 style="font-weight: bold">空调导风板巡检记录表</h1>
          <div class="xjOrder">HD/JL ZLB-011</div>
        </div>
      </div>
      <div v-if="open">
        <table style="font-size: 14px; height: 500px">
          <tr>
            <td>机台</td>
            <td>{{ xjtDataObj.xjtJtbh }}</td>
            <td>物料名称</td>
            <td colspan="2">{{ xjtDataObj.xjtWlpm }}</td>
            <td>物料编码</td>
            <td colspan="3">{{ xjtDataObj.xjtCustwldm }}</td>
            <td>检查日期</td>
            <td colspan="2">{{ xjtDataObj.xjtJyrq }}</td>
            <td>班别</td>
            <td>{{ xjtDataObj.xjtBbdm }}</td>
          </tr>
          <tr>
            <td rowspan="2">
              检查
              <br />
              时间
              <br />
              2H/1模
            </td>
            <td>外观</td>
            <td colspan="2" class="required">
              关键尺寸
              <!-- <span style="color: red">*</span> -->
            </td>
            <td colspan="2">变形量</td>
            <td class="required">色差（不允许偏黄）</td>
            <td>光泽度</td>
            <td class="required">重量</td>
            <td>包装方式</td>
            <td rowspan="2">判定</td>
            <td rowspan="2">检查员</td>
            <td rowspan="2" style="width: 10%">备注</td>
            <td rowspan="2" style="width: 5%">保存</td>
          </tr>
          <tr>
            <td>表面不得有披锋毛刺、缺口、缩水</td>
            <td colspan="2">
              <div v-if="xjtDataObj.xjtJccc1X">
                {{ parseFloat(xjtDataObj.xjtJccc1X).toFixed(2) }}~{{
                  parseFloat(xjtDataObj.xjtJccc1S).toFixed(2)
                }}
              </div>
            </td>
            <td>Y方向最大变形（镰刀型）≤0.5mm</td>
            <td>装配变形量≤1.0mm</td>
            <td>{{ xjtDataObj.xjtStandardColor }}</td>
            <td>&emsp;</td>
            <td>
              {{ parseFloat(xjtDataObj.xjtJzX).toFixed(1) }}~{{
                parseFloat(xjtDataObj.xjtJzS).toFixed(1)
              }}
            </td>
            <td>是否使用刀卡放置，待产品冷却后放置工装车</td>
          </tr>
          <tr>
            <td>H1</td>
            <!--            外观-->
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtViewTen"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <!--            尺寸-->
            <td>
              <Input
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtSizeoneCavoneTen"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtSizeoneCavtwoTen"
                size="small"
                style="width: 80%"
              />
            </td>
            <!--            变形量-->
            <td>
              <Input
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtYDirectionTen"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtAssembleTen"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtColourTen"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtLustre1"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtWeightoneCavoneTen"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtKnifecardTen"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtJudgementTen"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <div :disabled="timeDay != 'H1'" style="text-align: center">
                {{ xjtDataObj2.xjtJyryTenName }}
              </div>
            </td>
            <td>
              <autocomplete-bz
                :disabled="timeDay != 'H1'"
                v-model="xjtDataObj2.xjtDescTen"
                size="small"
              />
            </td>
            <td>
              <el-button
                type="primary"
                @click="handleRow"
                size="small"
                :disabled="timeDay != 'H1'"
                >保存</el-button
              >
            </td>
          </tr>
          <tr>
            <td>H2</td>
            <!--            外观-->
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtViewZero"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <!--            尺寸-->
            <td>
              <Input
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtSizeoneCavoneZero"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtSizeoneCavtwoZero"
                size="small"
                style="width: 80%"
              />
            </td>
            <!--            变形量-->
            <td>
              <Input
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtYDirectionZero"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtAssembleZero"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtColourZero"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtLustre2"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtWeightoneCavoneZero"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtKnifecardZero"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtJudgementZero"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <div :disabled="timeDay != 'H2'" style="text-align: center">
                {{ xjtDataObj2.xjtJyryZeroName }}
              </div>
            </td>
            <td>
              <autocomplete-bz
                :disabled="timeDay != 'H2'"
                v-model="xjtDataObj2.xjtDescZero"
                size="small"
              />
            </td>
            <td>
              <el-button
                type="primary"
                @click="handleRow"
                size="small"
                :disabled="timeDay != 'H2'"
                >保存</el-button
              >
            </td>
          </tr>
          <tr>
            <td>H3</td>
            <!--            外观-->
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtViewTwo"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <!--            尺寸-->
            <td>
              <Input
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtSizeoneCavoneTwo"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtSizeoneCavtwoTwo"
                size="small"
                style="width: 80%"
              />
            </td>
            <!--            变形量-->
            <td>
              <Input
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtYDirectionTwo"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtAssembleTwo"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtColourTwo"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtLustre3"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtWeightoneCavoneTwo"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtKnifecardTwo"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H3'"
                v-model="xjtDataObj2.xjtJudgementTwo"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <div :disabled="timeDay != 'H3'" style="text-align: center">
                {{ xjtDataObj2.xjtJyryTwoName }}
              </div>
            </td>
            <td>
              <autocomplete-bz
                v-model="xjtDataObj2.xjtDescTwo"
                :disabled="timeDay != 'H3'"
                size="small"
              />
            </td>
            <td>
              <el-button
                type="primary"
                @click="handleRow"
                size="small"
                :disabled="timeDay != 'H3'"
                >保存</el-button
              >
            </td>
          </tr>
          <tr>
            <td>H4</td>
            <!--            外观-->
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtViewFour"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <!--            尺寸-->
            <td>
              <Input
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtSizeoneCavoneFour"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtSizeoneCavtwoFour"
                size="small"
                style="width: 80%"
              />
            </td>
            <!--            变形量-->
            <td>
              <Input
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtYDirectionFour"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtAssembleFour"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtColourFour"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtLustre4"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtWeightoneCavoneFour"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Select
                :disabled="timeDay != 'H4'"
                placeholder=" "
                v-model="xjtDataObj2.xjtKnifecardFour"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <Select
                :disabled="timeDay != 'H4'"
                placeholder=" "
                v-model="xjtDataObj2.xjtJudgementFour"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <div :disabled="timeDay != 'H4'" style="text-align: center">
                {{ xjtDataObj2.xjtJyryFourName }}
              </div>
            </td>
            <td>
              <autocomplete-bz
                :disabled="timeDay != 'H4'"
                v-model="xjtDataObj2.xjtDescFour"
                size="small"
              />
            </td>
            <td>
              <el-button
                type="primary"
                @click="handleRow"
                size="small"
                :disabled="timeDay != 'H4'"
                >保存</el-button
              >
            </td>
          </tr>
          <tr>
            <td>H5</td>
            <!--            外观-->
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H5'"
                v-model="xjtDataObj2.xjtViewSix"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <!--            尺寸-->
            <td>
              <Input
                v-model="xjtDataObj2.xjtSizeoneCavoneSix"
                :disabled="timeDay != 'H5'"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                v-model="xjtDataObj2.xjtSizeoneCavtwoSix"
                :disabled="timeDay != 'H5'"
                size="small"
                style="width: 80%"
              />
            </td>
            <!--            变形量-->
            <td>
              <Input
                v-model="xjtDataObj2.xjtYDirectionSix"
                :disabled="timeDay != 'H5'"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                v-model="xjtDataObj2.xjtAssembleSix"
                :disabled="timeDay != 'H5'"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                v-model="xjtDataObj2.xjtColourSix"
                :disabled="timeDay != 'H5'"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                :disabled="timeDay != 'H5'"
                v-model="xjtDataObj2.xjtLustre5"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Input
                v-model="xjtDataObj2.xjtWeightoneCavoneSix"
                :disabled="timeDay != 'H5'"
                size="small"
                style="width: 80%"
              />
            </td>
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H5'"
                v-model="xjtDataObj2.xjtKnifecardSix"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <Select
                placeholder=" "
                :disabled="timeDay != 'H5'"
                v-model="xjtDataObj2.xjtJudgementSix"
                size="small"
                style="width: 80%"
              >
                <Option
                  v-for="item in cityList"
                  :value="item.value"
                  :key="item.value"
                  >{{ item.label }}</Option
                >
              </Select>
            </td>
            <td>
              <div :disabled="timeDay != 'H5'" style="text-align: center">
                {{ xjtDataObj2.xjtJyrySixName }}
              </div>
            </td>
            <td>
              <autocomplete-bz
                :disabled="timeDay != 'H5'"
                v-model="xjtDataObj2.xjtDescSix"
                size="small"
              />
            </td>
            <td>
              <el-button
                type="primary"
                @click="handleRow"
                size="mini"
                :disabled="timeDay != 'H5'"
                >保存</el-button
              >
            </td>
          </tr>
          <tr>
            <td style="text-align: left" colspan="14">
              说明：①关键尺寸按图纸或检验文件规定；②测量颜色时应于不同位置测三次以上，以客户提供的样板或色板为测量标准；
              ③尺寸、颜色、重量等测量周期按相关检验文件规定；④包装方式按控制计划与SOP执行；⑤检测项目符合时在判定栏注明“OK”，不符合时注明“NG”，并简要注明不良内容，班首件检验时应注明“班首件”；⑤测试数据不够栏填写可以另起页填写。
            </td>
          </tr>
        </table>
        <div style="display: block; text-align: right; margin-top: 10px">
          <el-button type="primary" size="mini" @click="open = false"
            >退出</el-button
          >
        </div>
      </div>
      <div slot="footer"></div>
    </el-dialog>
  </div>
</template>

<script>
import { parseTime } from "@/utils/ruoyi";
import {
  listBaffleDedicatedTemplateById,
  listXjtData,
  saveBaffleDedicatedTemplate,
} from "@/api/quality/productBom";
import AutocompleteBz from "../AutocompleteBz.vue";
export default {
  components: { AutocompleteBz },
  data() {
    return {
      //外部数据表格
      xjtData: [],
      xjtData2: [],
      xjtDataObj: [],
      xjtDataObj2: [],
      xjtDataRow: [],
      tableData: [],
      tableData2: [],
      cityList: [
        {
          value: "/",
          label: "/",
        },
        {
          value: "OK",
          label: "OK",
        },
        {
          value: "NG",
          label: "NG",
        },
      ],
      value3: " ",
      title: "",
      open: false,
      dom1: null,
      dom2: null,
      //当前时间
      nowTime: "",
      check_search: false,
      total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: document.body.clientHeight > 900 ? 25 : 17,
        xjtType: "A",
        xjtDateBegin: this.getTime(new Date().getTime() - 86400 * 30000).slice(
          0,
          10
        ),
        xjtDateEnd: this.getTime(new Date().getTime() + 86400 * 60000).slice(
          0,
          10
        ),
      },
      timeDay: null,
      hTime: {
        H1: "H1",
        H2: "H2",
        H3: "H3",
        H4: "H4",
        H5: "H5",
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    listenerScroll() {
      this.dom2.addEventListener("scroll", () => {
        // 横滚
        this.dom1.scrollLeft = this.dom2.scrollLeft;
      });
    },

    getList() {
      this.queryParams.xjtDateBegin = this.moment(
        this.queryParams.xjtDateBegin
      ).format("YYYY-MM-DD");
      this.queryParams.xjtDateEnd = this.moment(
        this.queryParams.xjtDateEnd
      ).format("YYYY-MM-DD");

      listXjtData(this.queryParams).then((res) => {
        this.xjtData = res.rows;
        this.total = res.total;
      });
    },
    handleUpdate(row) {
      this.xjtDataRow = row;
      this.timeDay = row.timeDay;
      //当前时间段
      this.nowTime = row.timeDay;
      this.open = true;
      //请求数据,按照机台编号,
      listBaffleDedicatedTemplateById(row.xjtId).then((res) => {
        let xjtData1 = res.data.list1.map((o) => {
          if (o.xjtInformation) {
            let obj = JSON.parse(o.xjtInformation);
            o = Object.assign(o, obj);
          }
          return o;
        });
        let xjtData2 = res.data.list2.map((o) => {
          if (o.xjtInformation) {
            let obj = JSON.parse(o.xjtInformation);
            o = Object.assign(o, obj);
          }
          return o;
        });
        xjtData1.map((item) => {
          this.xjtDataObj = item;
        });
        xjtData2.map((item) => {
          this.xjtDataObj2 = item;
        });
      });
    },
    handleRow() {
      switch (this.timeDay) {
        case "H1":
          this.xjtDataObj2.xjtAnalyzeTen = this.getTime();
          this.xjtDataObj2.xjtFlagTen = "1";
          this.xjtDataObj2.xjtJyryTen = this.$store.getters.name;
          break;
        case "H2":
          this.xjtDataObj2.xjtAnalyzeZero = this.getTime();
          this.xjtDataObj2.xjtFlagZero = "1";
          this.xjtDataObj2.xjtJyryZero = this.$store.getters.name;
          break;
        case "H3":
          this.xjtDataObj2.xjtAnalyzeTwo = this.getTime();
          this.xjtDataObj2.xjtFlagTwo = "1";
          this.xjtDataObj2.xjtJyryTwo = this.$store.getters.name;
          break;
        case "H4":
          this.xjtDataObj2.xjtAnalyzeFour = this.getTime();
          this.xjtDataObj2.xjtFlagFour = "1";
          this.xjtDataObj2.xjtJyryFour = this.$store.getters.name;
          break;
        case "H5":
          this.xjtDataObj2.xjtAnalyzeSix = this.getTime();
          this.xjtDataObj2.xjtFlagSix = "1";
          this.xjtDataObj2.xjtJyrySix = this.$store.getters.name;
          break;
      }
      let tmpObj = {};
      for (let i = 5; i > 0; i--) {
        let k = "xjtLustre" + i;
        if (this.xjtDataObj2[k]) tmpObj[k] = this.xjtDataObj2[k];
      }
      this.xjtDataObj2.xjtInformation = JSON.stringify(tmpObj);
      if (this.testRules(this.timeDay)) {
      } else {
        saveBaffleDedicatedTemplate(this.xjtDataObj2).then((res) => {
          this.open = false;
          this.$message.success("保存成功！");
          this.getList();
        });
      }
    },
    cancel() {
      this.open = false;
    },
    get_date(e, type) {
      if (type === "s") {
        this.queryParams.xjtDateBegin = e;
      } else if (type === "e") {
        this.queryParams.xjtDateEnd = e;
      }
    },
    getTime(time = new Date()) {
      return parseTime(time);
    },
    pageChange(page) {
      this.queryParams.pageNum = page;
      this.getList();
    },
    testRules(day) {
      switch (day) {
        case "H1":
          if (
            !(
              this.xjtDataObj2.xjtSizeoneCavoneTen ||
              this.xjtDataObj2.xjtSizeoneCavtwoTen
            )
          ) {
            this.$message.error("尺寸必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtColourTen) {
            this.$message.error("色差必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtWeightoneCavoneTen) {
            this.$message.error("重量必填！");
            return true;
          } else {
            return false;
          }
          break;
        case "H2":
          if (
            !(
              this.xjtDataObj2.xjtSizeoneCavoneZero ||
              this.xjtDataObj2.xjtSizeoneCavtwoZero
            )
          ) {
            this.$message.error("尺寸必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtColourZero) {
            this.$message.error("色差必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtWeightoneCavoneZero) {
            this.$message.error("重量必填！");
            return true;
          } else {
            return false;
          }
          break;
        case "H3":
          if (
            !(
              this.xjtDataObj2.xjtSizeoneCavoneTwo ||
              this.xjtDataObj2.xjtSizeoneCavtwoTwo
            )
          ) {
            this.$message.error("尺寸必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtColourTwo) {
            this.$message.error("色差必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtWeightoneCavoneTwo) {
            this.$message.error("重量必填！");
            return true;
          } else {
            return false;
          }
          break;
        case "H4":
          if (
            !(
              this.xjtDataObj2.xjtSizeoneCavoneFour ||
              this.xjtDataObj2.xjtSizeoneCavtwoFour
            )
          ) {
            this.$message.error("尺寸必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtColourFour) {
            this.$message.error("色差必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtWeightoneCavoneFour) {
            this.$message.error("重量必填！");
            return true;
          } else {
            return false;
          }
          break;
        case "H5":
          if (
            !(
              this.xjtDataObj2.xjtSizeoneCavoneSix ||
              this.xjtDataObj2.xjtSizeoneCavtwoSix
            )
          ) {
            this.$message.error("尺寸必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtColourSix) {
            this.$message.error("色差必填！");
            return true;
          } else if (!this.xjtDataObj2.xjtWeightoneCavoneSix) {
            this.$message.error("重量必填！");
            return true;
          } else {
            return false;
          }
          break;
      }
    },
  },
};
</script>

<style scoped>
input {
  width: 60px;
}

table {
  width: 100%;
  height: 50px;
  border-spacing: 0;
  border-collapse: collapse;
  text-align: center;
  font-weight: bold;
}

table td {
  height: 40px;
  width: 82px;
  border: 1px solid black;
}

.xjTable {
  width: 100%;
  text-align: center;
  font-size: 24px;
  height: 48px;
  font-weight: bold;
}

.hdLogo {
  position: absolute;
  left: 34px;
  bottom: 8px;
  width: 130px;
  height: 58px;
}

.xjOrder {
  position: absolute;
  right: 70px;
  bottom: 2px;
  font-weight: bold;
  font-size: 16px;
}
</style>
<style lang="scss" scoped>
.con-page {
  ::v-deep .el-table__body tbody .el-table__row .el-table__cell {
    padding: 0 !important;
  }
  ::v-deep .el-table thead th {
    height: 30px;
    font-size: 12px;
    padding: 0px 0px 0px 0px;
    color: #47494e;
    background: #f8f8f8 !important;
  }

  ::v-deep .el-select .el-input .el-input__suffix .el-input__suffix-inner {
    display: none;
  }
  ::v-deep .el-table__body-wrapper .el-select .el-input .el-input__inner {
    text-align: center;
    height: 28px;
    padding: 0;
  }
  /*z*/
  ::v-deep .el-input__inner {
    padding: 0;
    height: 20px;
    line-height: 20px;
  }
  ::v-deep .el-table .cell,
  .el-table--border td:first-child .cell {
    padding: 0;
  }
  ::v-deep .el-table .cell {
    padding: 0 0 0 0;
  }
  ::v-deep .el-input--mini .el-input__inner {
    height: 18px;
    line-height: 18px;
  }
  ::v-deep .el-table td {
    padding: 0 0 0 0;
  }
  ::v-deep .inputWidth {
    width: 50px;
  }
  ::v-deep .divHeight {
    border-bottom: 1px solid #868686;
    height: 20px;
  }

  ::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td {
    background-color: skyblue !important;
  }
}
</style>
